package com.djl.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @program: cloud
 * @description:
 * @author: Mr.dai
 * @create: 2021-09-18 11:56
 **/
@Configuration
public class ApplicationContextConfig {
    //@bean 为了注入    @LoadBalanced可以做到负载均衡
    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
    //
}
